/* eslint-disable jsdoc/no-restricted-syntax */
import NgModelViewTpl from "./ng-model.view.tpl.html";
import { defineView } from "@/routers/tools.mjs";

/**
 * @type {DefineView}
 */
const NgModelView = defineView({
  controller: class NgModelViewCtrl {
    static $inject = ["$scope"];

    /**
     * @param {ng.WIScope} $scope
     */
    constructor($scope) {
      this.$scope = $scope;
      this.userType = 111;
      this.$scope.DebugButtonHTML = DebugButtonHTML;
    }

    // this.$form = $form;
    /**
     * @type {Record<string, string & ng.INgModelController & ng.INgModelController>}
     */
    model = /** @type {any} */ ({ value1: "", value2: "" });

    /**
     * @type {Record<string, string & ng.IFormController & ng.INgModelController> }
     */
    theFormData = {};

    /**
     * @type {ng.INgModelOptions}
     */
    modelOptions = {
      // updateOn: "blur",
      // getterSetter: true,
    };

    handleClick() {
      console.log("NgModelViewCtrl", this.$scope);
    }
  },
  controllerAs: "$ctrl",
  template: html` ${NgModelViewTpl} ${DebugButtonHTML("$ctrl")} `,
});

export default NgModelView;

// src/view/DeveloperGuide/BusyBox/ng-model.view.mjs
// -> ./src/view/DeveloperGuide/BusyBox/index.mjs
// -> ./src/view/DeveloperGuide/BusyBox/sub-routing.mjs
// -> ./src/view/DeveloperGuide/mod.mjs
// -> ./src/view/DeveloperGuide/mod-routing.mjs
// -> ./src/view/root.mjs
// -> ./src/view/root-routing.mjs
// -> ./src/bootstrap.mjs
if (import.meta.webpackHot) {
  import.meta.webpackHot.accept();
}
